package com.List集合;

import java.util.ArrayList;
import java.util.LinkedList;

public class TestArrayListAndLinkedList {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<>();
        arrayList.add("hello");
        arrayList.add("world");
        arrayList.add("java");
        //遍历
        for (String s : arrayList) {
            System.out.println(s);
        }

        System.out.println("=========");

        LinkedList<String> strings = new LinkedList<>();
        strings.add("hello");
        strings.add("world");
        strings.add("java");

        for (String string : strings) {
            System.out.println(string);
        }
    }

}
